import React, { Component, Fragment } from 'react';


import { WapperStyle } from './wapperStyle';

import { Icon, Button } from 'antd-mobile';

class Wrapper extends Component {
  

    constructor(){
        super()
        this.state = {
            flagShow:true
        }
    }

    show= () =>{
        this.setState({
            flagShow:!this.state.flagShow
        })
    }
    componentWillReceiveProps(){
        this.setState({
            flagShow:true
        })
    }
   

   
    render() {
        console.log(this.state.flagShow)
        return (
            <Fragment>
                {this.state.flagShow && <WapperStyle>
                    <h3 className="title">
                        <span>激活优惠券</span>
                        <i><Icon type="cross" /></i>
                    </h3>
                    <div className="input">
                        <input type="text" placeholder="输入优惠券码"></input>
                    </div>
                    <div className="submit">
                        <Button onClick ={ this.show } >确定</Button>
                    </div>
                </WapperStyle>}
            </Fragment>
        )
    }
}

export default Wrapper;